<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        var R = parseInt(prompt("请输入半径"));
        function f(R) {
            var mj = Math.PI*R*R;
            document.write("面积为:"+mj);
            var zc = Math.PI*(R+R);
            document.write("周长为："+zc);
        }
        f(R);
    </script>
</head>
<body>

</body>
</html>